package cn.iocoder.yudao.module.digital.service.cardchannel.model;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * Description:
 * Author: li
 * Date: 2024/2/21
 */
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
public class GenerateEGiftRequest {
    private String giftAmount; // The amount associated with the eGift
    /**
     * Retrieval Reference Number for the EGIFT transaction. To support downstream processing of this value,
     * we require that this field contain only numeric values prefixed with 0’s to complete full length of 12.
     * A unique value per transaction.
     */
    private String retrievalReferenceNumber;

    private String giftTo; // EGift receiver details.
    private String giftFrom; // EGift sender details.
    /**
     * Unique product ConfigurationId that identifies which card is ordered
     * <p>
     * Either upc or productConfigurationId should be provided
     */
    private String productConfigurationId;
    private String giftMessage; // Gift Message
    /**
     * Information regarding Person Purchasing Card
     * <p>
     * compliance mandated
     */
    private User purchaserInfo;
    private User recipientInfo; // Information regarding Person Receiving Card
    @JsonProperty("eGiftDetails")
    private EGiftDetails eGiftDetails; // EGiftDetails

    @Data
    @JsonInclude(JsonInclude.Include.NON_NULL)
    public static class User {
        private String firstName; // First Name of Person
        private String lastName; // Last Name of Person
        private String addressLine1; // Address Line 1
        private String addressLine2; // Address Line 2
        private String city;
        /**
         * State or Province (Required for Purchaser Info)
         * <p>
         * Used to enforce restricted product compliance mandates.
         * If state (or Province) is not supported for the country of purchase, postalCode must be sent instead.
         */
        private String state;
        private String postalCode; // Postal Code
        private String countryCode; // Country Code (Required for Purchaser Info in ISO 3166 alpha 3 format)
        private String phoneNumber;
        private String emailAddress;

    }

    @Data
    @JsonInclude(JsonInclude.Include.NON_NULL)
    public static class EGiftDetails {
        private List<AdditionalAttribute> additionalAttributes; // The list of Entity Attribute of the EGift

    }

    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    @JsonInclude(JsonInclude.Include.NON_NULL)
    public static class AdditionalAttribute {
        private String name;
        private String type;
        private String value;

    }
}

